﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class addEPCDevic : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //migrationBuilder.AlterColumn<string>(
            //    name: "MaterialName",
            //    table: "T_ShippingLockCell",
            //    type: "nvarchar(max)",
            //    nullable: true,
            //    oldClrType: typeof(string),
            //    oldType: "nvarchar(30)",
            //    oldMaxLength: 30,
            //    oldNullable: true);

            //migrationBuilder.AddColumn<string>(
            //    name: "MaterialEPCId",
            //    table: "T_Material",
            //    type: "nvarchar(max)",
            //    nullable: true);

            migrationBuilder.CreateTable(
                name: "EPCDevice",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    UserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AId = table.Column<int>(type: "int", nullable: true),
                    AName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EPCDevice", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "EPCDevice");

            migrationBuilder.DropColumn(
                name: "MaterialEPCId",
                table: "T_Material");

            migrationBuilder.AlterColumn<string>(
                name: "MaterialName",
                table: "T_ShippingLockCell",
                type: "nvarchar(30)",
                maxLength: 30,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);
        }
    }
}
